<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			/*function for (a,b) {
				return a+b;
			}
			function for (a,b,c) {
				return a+b+c;
			}
			console.log(f1(2,4));//NaN
			console.log(f(2,3,4));//9*/
			/*function  add(){
				var sum=0;
				for(var i=0;i<arguments.length;i++){
					sum+=arguments[i];
				}
				return sum;
			}
			console.log(add(4,5));
			console.log(add(4,5,6));*/
			
			
			function a(){
				if(arguments.length==2){
					var sum=0;
				for(var i=0;i<arguments.length;i++){
					sum+=arguments[i];
				}
				return sum;
				}else if(arguments.length==3){
					var sum=1;
				for(var i=0;i<arguments.length;i++){
					sum*=arguments[i];
				}
				console.log(sum);
				}
			}
			console.log(a(4,5));
			a(4,5,6);
		</script>
	</body>
</html>
